---------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  H:\Dropbox\office\choice\stata\for restat\2_tables.log
  log type:  text
 opened on:  14 May 2012, 12:30:58
Analysis do-file 2_tables run on 14 May 2012 at 12:30:58

. set mem 10m

Current memory allocation

                    current                                 memory usage
    settable          value     description                 (1M = 1024k)
    --------------------------------------------------------------------
    set maxvar         5000     max. variables allowed           1.947M
    set memory           10M    max. data space                 10.000M
    set matsize         400     max. RHS vars in models          1.254M
                                                            -----------
                                                                13.201M

. set more off 

. set rmsg on
r; t=0.00 12:30:58

. 
. 
. 
. ************************************************
. ************Table 2*****************************
. ********Demographic characteristics*************
. ***********Main experiment**********************
. ************************************************
. 
. use choice_experiments_wide, clear
r; t=0.00 12:30:58

. 
. *calculate the required demographic summary statistics
. bys experiment: egen average_age=mean(age)
r; t=0.00 12:30:58

. bys experiment: egen stdev_age=sd(age)
r; t=0.00 12:30:58

. bys experiment: egen percent_male=mean(sexismale)
r; t=0.00 12:30:58

. bys experiment: egen percent_edhigh=mean(edhigh)
r; t=0.00 12:30:58

. bys experiment: egen percent_edsomecol=mean(edsomecol)
r; t=0.00 12:30:58

. bys experiment: egen percent_edcolgrad=mean(edcolgrad)
r; t=0.00 12:30:58

. bys experiment: egen percent_edpost=mean(edpost)
r; t=0.00 12:30:58

. bys experiment: egen nsubjects=count(id)
r; t=0.00 12:30:58

. 
. *by age groups
. bys experiment agegroup: egen average_age_ag=mean(age)
r; t=0.00 12:30:58

. bys experiment agegroup: egen stdev_age_ag=sd(age)
r; t=0.00 12:30:58

. bys experiment agegroup: egen percent_male_ag=mean(sexismale)
r; t=0.00 12:30:58

. bys experiment agegroup: egen percent_edhigh_ag=mean(edhigh)
r; t=0.00 12:30:58

. bys experiment agegroup: egen percent_edsomecol_ag=mean(edsomecol)
r; t=0.00 12:30:58

. bys experiment agegroup: egen percent_edcolgrad_ag=mean(edcolgrad)
r; t=0.00 12:30:58

. bys experiment agegroup: egen percent_edpost_ag=mean(edpost)
r; t=0.00 12:30:58

. bys experiment agegroup: egen nsubjects_ag=count(id)
r; t=0.00 12:30:58

. 
. *collapse the data to create a file containing only the table
. *use only the main experiment data
. preserve
r; t=0.00 12:30:58

. keep if experiment==1
(63 observations deleted)
r; t=0.00 12:30:58

. collapse average_age stdev_age percent_male percent_edhigh percent_edsomecol percent_edcolgrad pe
> rcent_edpost nsubjects
r; t=0.01 12:30:58

. gen agegroup=0
r; t=0.00 12:30:58

. save temp1, replace
file temp1.dta saved
r; t=0.00 12:30:58

. restore
r; t=0.00 12:30:58

. keep if experiment==1
(63 observations deleted)
r; t=0.00 12:30:58

. collapse average_age_ag stdev_age_ag percent_male_ag percent_edhigh_ag percent_edsomecol_ag perce
> nt_edcolgrad_ag percent_edpost_ag nsubjects_ag, by(agegroup)
r; t=0.01 12:30:58

. local var "average_age stdev_age percent_male percent_edhigh percent_edsomecol percent_edcolgrad 
> percent_edpost nsubjects"
r; t=0.00 12:30:58

. foreach i of local var {
  2.         rename `i'_ag `i'
  3. }
r; t=0.00 12:30:58

. save temp2, replace
(note: file temp2.dta not found)
file temp2.dta saved
r; t=0.00 12:30:58

. 
. use temp1, clear
r; t=0.00 12:30:58

. append using temp2
r; t=0.00 12:30:58

. 
. sort agegroup
r; t=0.00 12:30:58

. label define ag 0 "All ages" 1 "18 to 40" 2 "41 to 60" 3 "Over 60"
r; t=0.00 12:30:58

. label values agegroup ag
r; t=0.00 12:30:58

. 
. save table2, replace
(note: file table2.dta not found)
file table2.dta saved
r; t=0.00 12:30:58

. 
. 
. ************************************************
. ************Table 3*****************************
. ****Frequency of (nearly) optimal choice********
. ***********Main experiment**********************
. ************************************************
. 
. use choice_experiments, clear
r; t=0.00 12:30:58

. 
. *use only the main experiment data
. keep if experiment==1
(252 observations deleted)
r; t=0.00 12:30:58

. 
. *drop the practice round
. drop if round==1
(127 observations deleted)
r; t=0.00 12:30:58

. 
. preserve
r; t=0.00 12:30:58

. *overall frequencies
. egen optimal_freq=mean(optimal)
r; t=0.00 12:30:58

. egen nearly_optimal_freq=mean(optimalten)
r; t=0.00 12:30:58

. egen observations=count(id)
r; t=0.00 12:30:58

. gen type=1
r; t=0.00 12:30:58

. collapse optimal_freq nearly_optimal_freq observations, by(type)
r; t=0.01 12:30:58

. save temp1, replace
file temp1.dta saved
r; t=0.00 12:30:58

. restore
r; t=0.00 12:30:58

. preserve
r; t=0.01 12:30:58

. *frequencies across the number of options
. bys noptions: egen optimal_freq=mean(optimal)
r; t=0.00 12:30:58

. bys noptions: egen nearly_optimal_freq=mean(optimalten)
r; t=0.00 12:30:58

. bys noptions: egen observations=count(id)
r; t=0.00 12:30:58

. gen type=2
r; t=0.00 12:30:58

. collapse optimal_freq nearly_optimal_freq observations, by(type noptions)
r; t=0.01 12:30:58

. gen str10 desc="4" if noptions==4
(1 missing value generated)
r; t=0.00 12:30:58

. replace desc="13" if noptions==13
(1 real change made)
r; t=0.00 12:30:58

. drop noptions
r; t=0.00 12:30:58

. save temp2, replace
file temp2.dta saved
r; t=0.00 12:30:58

. restore
r; t=0.00 12:30:58

. preserve
r; t=0.00 12:30:58

. *frequencies across the number of states
. bys natt: egen optimal_freq=mean(optimal)
r; t=0.00 12:30:58

. bys natt: egen nearly_optimal_freq=mean(optimalten)
r; t=0.00 12:30:58

. bys natt: egen observations=count(id)
r; t=0.00 12:30:58

. gen type=3
r; t=0.00 12:30:58

. collapse optimal_freq nearly_optimal_freq observations, by(type natt)
r; t=0.01 12:30:58

. gen str10 desc="6" if natt==6
(1 missing value generated)
r; t=0.00 12:30:58

. replace desc="10" if natt==10
(1 real change made)
r; t=0.00 12:30:58

. drop natt
r; t=0.00 12:30:58

. save temp3, replace
(note: file temp3.dta not found)
file temp3.dta saved
r; t=0.00 12:30:58

. restore
r; t=0.00 12:30:58

. preserve
r; t=0.00 12:30:58

. *frequencies across pdfs
. bys pdf_even: egen optimal_freq=mean(optimal)
r; t=0.00 12:30:59

. bys pdf_even: egen nearly_optimal_freq=mean(optimalten)
r; t=0.00 12:30:59

. bys pdf_even: egen observations=count(id)
r; t=0.00 12:30:59

. gen type=4
r; t=0.00 12:30:59

. collapse optimal_freq nearly_optimal_freq observations, by(type pdf_even)
r; t=0.01 12:30:59

. gen str10 desc="1 (even)" if pdf_even==1
(1 missing value generated)
r; t=0.00 12:30:59

. replace desc="2(extreme)" if pdf_even==0
(1 real change made)
r; t=0.00 12:30:59

. drop pdf_even
r; t=0.00 12:30:59

. save temp4, replace
(note: file temp4.dta not found)
file temp4.dta saved
r; t=0.00 12:30:59

. restore
r; t=0.00 12:30:59

. preserve
r; t=0.01 12:30:59

. *frequencies across age
. bys agegroup: egen optimal_freq=mean(optimal)
r; t=0.00 12:30:59

. bys agegroup: egen nearly_optimal_freq=mean(optimalten)
r; t=0.00 12:30:59

. bys agegroup: egen observations=count(id)
r; t=0.00 12:30:59

. gen type=5
r; t=0.00 12:30:59

. collapse optimal_freq nearly_optimal_freq observations, by(type agegroup)
r; t=0.01 12:30:59

. gen str10 desc="18-40" if agegroup==1
(2 missing values generated)
r; t=0.00 12:30:59

. replace desc="41-60" if agegroup==2
(1 real change made)
r; t=0.00 12:30:59

. replace desc="Over 60" if agegroup==3
(1 real change made)
r; t=0.00 12:30:59

. drop agegroup
r; t=0.00 12:30:59

. save temp5, replace
(note: file temp5.dta not found)
file temp5.dta saved
r; t=0.00 12:30:59

. restore
r; t=0.00 12:30:59

. *frequencies across gender
. bys sexismale: egen optimal_freq=mean(optimal)
r; t=0.00 12:30:59

. bys sexismale: egen nearly_optimal_freq=mean(optimalten)
r; t=0.00 12:30:59

. bys sexismale: egen observations=count(id)
r; t=0.00 12:30:59

. gen type=6
r; t=0.00 12:30:59

. collapse optimal_freq nearly_optimal_freq observations, by(type sexismale)
r; t=0.01 12:30:59

. gen str10 desc="Men" if sexismale==1
(1 missing value generated)
r; t=0.00 12:30:59

. replace desc="Women" if sexismale==0
(1 real change made)
r; t=0.00 12:30:59

. drop sexismale
r; t=0.00 12:30:59

. save temp6, replace
(note: file temp6.dta not found)
file temp6.dta saved
r; t=0.00 12:30:59

. 
. clear
r; t=0.00 12:30:59

. 
. forval i=1/6 {
  2.         append using temp`i'
  3. }
r; t=0.00 12:30:59

. 
. label define type 1 "All" 2 "Options" 3 "States" 4 "PDF" 5 "Age" 6 "Sex"
r; t=0.00 12:30:59

. label values type type
r; t=0.00 12:30:59

. 
. placevar desc, after(type)
r; t=0.00 12:30:59

. sort type desc
r; t=0.00 12:30:59

. 
. save table3, replace
(note: file table3.dta not found)
file table3.dta saved
r; t=0.00 12:30:59

. 
. 
. ************************************************
. ************Table 4*****************************
. *********Likelihood of optimal choice***********
. ***********Main experiment**********************
. ************************************************
. 
. use choice_experiments, clear
r; t=0.00 12:30:59

. 
. gen timesq=time*time
r; t=0.00 12:30:59

. gen timesq1000=timesq/1000
r; t=0.00 12:30:59

. gen older=(agegroup==3)
r; t=0.00 12:30:59

. gen older_nopt_dum3=older*nopt_dum3
r; t=0.00 12:30:59

. 
. probit optimal nopt_dum3 natt_dum4 pdf_extreme if experiment==1 & round~=1, robust cluster(id)

Iteration 0:   log pseudolikelihood = -685.21298  
Iteration 1:   log pseudolikelihood = -668.69365  
Iteration 2:   log pseudolikelihood = -668.68416  
Iteration 3:   log pseudolikelihood = -668.68416  

Probit regression                                 Number of obs   =       1016
                                                  Wald chi2(3)    =      42.38
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -668.68416                 Pseudo R2       =     0.0241

                                   (Std. Err. adjusted for 127 clusters in id)
------------------------------------------------------------------------------
             |               Robust
     optimal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   nopt_dum3 |  -.3330801   .0742448    -4.49   0.000    -.4785972   -.1875631
   natt_dum4 |  -.0842829   .0712774    -1.18   0.237    -.2239841    .0554182
 pdf_extreme |   .3120177   .0639209     4.88   0.000     .1867349    .4373004
       _cons |  -.1985997   .0899927    -2.21   0.027    -.3749821   -.0222173
------------------------------------------------------------------------------
r; t=1.79 12:31:00

. 
. probit optimal nopt_dum3 natt_dum4 pdf_extreme age sex edpost if experiment==1 & round~=1, robust
>  cluster(id)

Iteration 0:   log pseudolikelihood = -685.21298  
Iteration 1:   log pseudolikelihood = -645.89006  
Iteration 2:   log pseudolikelihood = -645.74986  
Iteration 3:   log pseudolikelihood = -645.74985  

Probit regression                                 Number of obs   =       1016
                                                  Wald chi2(6)    =      63.71
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -645.74985                 Pseudo R2       =     0.0576

                                   (Std. Err. adjusted for 127 clusters in id)
------------------------------------------------------------------------------
             |               Robust
     optimal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   nopt_dum3 |  -.3497793   .0764508    -4.58   0.000    -.4996201   -.1999385
   natt_dum4 |  -.0881756   .0738479    -1.19   0.232    -.2329148    .0565635
 pdf_extreme |   .3243223   .0659481     4.92   0.000     .1950665    .4535781
         age |  -.0144081   .0046113    -3.12   0.002    -.0234461     -.00537
   sexismale |  -.1331408   .1427906    -0.93   0.351    -.4130053    .1467237
      edpost |   .5759343   .1669128     3.45   0.001     .2487913    .9030774
       _cons |   .4909204   .2771817     1.77   0.077    -.0523457    1.034187
------------------------------------------------------------------------------
r; t=0.03 12:31:00

. 
. probit optimal nopt_dum3 natt_dum4 pdf_extreme age sex edpost older_nopt_dum3 if experiment==1 & 
> round~=1, robust cluster(id)

Iteration 0:   log pseudolikelihood = -685.21298  
Iteration 1:   log pseudolikelihood = -640.88106  
Iteration 2:   log pseudolikelihood = -640.77652  
Iteration 3:   log pseudolikelihood = -640.77652  

Probit regression                                 Number of obs   =       1016
                                                  Wald chi2(7)    =      68.82
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -640.77652                 Pseudo R2       =     0.0649

                                   (Std. Err. adjusted for 127 clusters in id)
------------------------------------------------------------------------------
             |               Robust
     optimal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   nopt_dum3 |  -.1922676   .0914708    -2.10   0.036    -.3715471   -.0129881
   natt_dum4 |  -.0885177   .0743613    -1.19   0.234    -.2342632    .0572278
 pdf_extreme |   .3291746   .0664348     4.95   0.000     .1989648    .4593844
         age |  -.0095041   .0051185    -1.86   0.063    -.0195362     .000528
   sexismale |  -.1552373   .1407858    -1.10   0.270    -.4311723    .1206977
      edpost |   .6209619   .1638589     3.79   0.000     .2998044    .9421195
older_nopt~3 |  -.4794174    .183085    -2.62   0.009    -.8382574   -.1205774
       _cons |   .2438921   .3008036     0.81   0.417    -.3456722    .8334564
------------------------------------------------------------------------------
r; t=0.03 12:31:00

. 
. probit optimal nopt_dum3 natt_dum4 pdf_extreme time timesq1000 age sex edpost older_nopt_dum3 if 
> experiment==1 & round~=1, robust cluster(id)

Iteration 0:   log pseudolikelihood = -685.21298  
Iteration 1:   log pseudolikelihood = -623.76259  
Iteration 2:   log pseudolikelihood = -623.61694  
Iteration 3:   log pseudolikelihood = -623.61694  

Probit regression                                 Number of obs   =       1016
                                                  Wald chi2(9)    =      79.29
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -623.61694                 Pseudo R2       =     0.0899

                                   (Std. Err. adjusted for 127 clusters in id)
------------------------------------------------------------------------------
             |               Robust
     optimal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   nopt_dum3 |  -.3076684   .0988802    -3.11   0.002    -.5014701   -.1138667
   natt_dum4 |  -.1466939   .0782545    -1.87   0.061      -.30007    .0066821
 pdf_extreme |   .3760347   .0703621     5.34   0.000     .2381276    .5139418
        time |   .0058013   .0012578     4.61   0.000     .0033361    .0082664
  timesq1000 |  -.0037683   .0010051    -3.75   0.000    -.0057383   -.0017983
         age |  -.0104549    .004771    -2.19   0.028    -.0198058   -.0011039
   sexismale |  -.0711615   .1351104    -0.53   0.598     -.335973      .19365
      edpost |   .5765793   .1556153     3.71   0.000     .2715789    .8815797
older_nopt~3 |  -.5015238    .191271    -2.62   0.009     -.876408   -.1266396
       _cons |   .0765277   .2871452     0.27   0.790    -.4862665    .6393219
------------------------------------------------------------------------------
r; t=0.04 12:31:00

. 
. 
. 
. ************************************************
. ************Table 5*****************************
. *********Average efficiency*********************
. ***********Main experiment**********************
. ************************************************
. 
. use choice_experiments, clear
r; t=0.00 12:31:00

. 
. *use only the main experiment data
. keep if experiment==1
(252 observations deleted)
r; t=0.00 12:31:00

. 
. *drop the practice round
. drop if round==1
(127 observations deleted)
r; t=0.00 12:31:00

. 
. bys id: egen temp1=total(pay)
r; t=0.05 12:31:00

. bys id: egen temp2=total(best_opt)
r; t=0.00 12:31:00

. bys id: egen temp3=total(average_payoff)
r; t=0.00 12:31:01

. 
. gen average_efficiency=temp1/temp2
r; t=0.00 12:31:01

. gen average_normalized_efficiency=(temp1-temp3)/(temp2-temp3)
r; t=0.00 12:31:01

. drop temp1 temp2 temp3
r; t=0.00 12:31:01

. 
. preserve
r; t=0.00 12:31:01

. *average overall efficiency
. egen observations=count(id)
r; t=0.00 12:31:01

. gen type=1
r; t=0.00 12:31:01

. collapse average_efficiency average_normalized_efficiency observations, by(type)
r; t=0.01 12:31:01

. save temp1, replace
file temp1.dta saved
r; t=0.00 12:31:01

. restore
r; t=0.00 12:31:01

. preserve
r; t=0.00 12:31:01

. *average efficiency across age
. bys agegroup: egen observations=count(id)
r; t=0.00 12:31:01

. gen type=2
r; t=0.00 12:31:01

. collapse average_efficiency average_normalized_efficiency observations, by(type agegroup)
r; t=0.01 12:31:01

. gen str10 desc="18-40" if agegroup==1
(2 missing values generated)
r; t=0.00 12:31:01

. replace desc="41-60" if agegroup==2
(1 real change made)
r; t=0.00 12:31:01

. replace desc="Over 60" if agegroup==3
(1 real change made)
r; t=0.00 12:31:01

. drop agegroup
r; t=0.00 12:31:01

. save temp2, replace
file temp2.dta saved
r; t=0.00 12:31:01

. restore
r; t=0.00 12:31:01

. *average efficiency across gender
. bys sexismale: egen observations=count(id)
r; t=0.00 12:31:01

. gen type=3
r; t=0.00 12:31:01

. collapse average_efficiency average_normalized_efficiency observations, by(type sexismale)
r; t=0.01 12:31:01

. gen str10 desc="Men" if sexismale==1
(1 missing value generated)
r; t=0.00 12:31:01

. replace desc="Women" if sexismale==0
(1 real change made)
r; t=0.00 12:31:01

. drop sexismale
r; t=0.00 12:31:01

. save temp3, replace
file temp3.dta saved
r; t=0.00 12:31:01

. 
. clear
r; t=0.00 12:31:01

. 
. forval i=1/3 {
  2.         append using temp`i'
  3. }
r; t=0.00 12:31:01

. 
. label define type 1 "All" 2 "Age" 3 "Sex"
r; t=0.00 12:31:01

. label values type type
r; t=0.00 12:31:01

. 
. placevar desc, after(type)
r; t=0.00 12:31:01

. sort type desc
r; t=0.00 12:31:01

. 
. save table5, replace
(note: file table5.dta not found)
file table5.dta saved
r; t=0.00 12:31:01

. 
. 
. 
. 
. ************************************************
. ************Table 6*****************************
. *********OLS estimates of Efficiency************
. ***********Main experiment**********************
. ************************************************
. 
. use choice_experiments, clear
r; t=0.00 12:31:01

. 
. *use only the main experiment data
. keep if experiment==1
(252 observations deleted)
r; t=0.00 12:31:01

. 
. *drop the practice round
. drop if round==1
(127 observations deleted)
r; t=0.00 12:31:01

. 
. bys id: egen temp1=total(pay)
r; t=0.00 12:31:01

. bys id: egen temp2=total(best_opt)
r; t=0.00 12:31:01

. bys id: egen temp3=total(average_payoff)
r; t=0.00 12:31:01

. 
. gen average_efficiency=temp1/temp2
r; t=0.00 12:31:01

. gen average_normalized_efficiency=(temp1-temp3)/(temp2-temp3)
r; t=0.00 12:31:01

. drop temp1 temp2 temp3
r; t=0.00 12:31:01

. 
. collapse (mean) average_efficiency (mean) average_normalized_efficiency (mean) optimality=optimal
> , by(id age education edhigh edsomecol edcolgrad edpost sexismale experiment agegroup)
r; t=0.01 12:31:01

. 
. replace average_efficiency=average_efficiency*100
(127 real changes made)
r; t=0.00 12:31:01

. replace average_normalized_efficiency=average_normalized_efficiency*100
(127 real changes made)
r; t=0.00 12:31:01

. replace optimality=optimality*100
(112 real changes made)
r; t=0.00 12:31:01

. 
. *average efficiency
. reg average_efficiency age sexismale edpost 

      Source |       SS       df       MS              Number of obs =     127
-------------+------------------------------           F(  3,   123) =    5.37
       Model |  1754.85846     3   584.95282           Prob > F      =  0.0016
    Residual |  13392.4867   123  108.882006           R-squared     =  0.1159
-------------+------------------------------           Adj R-squared =  0.0943
       Total |  15147.3452   126  120.217025           Root MSE      =  10.435

------------------------------------------------------------------------------
average_ef~y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.1815999   .0609628    -2.98   0.003    -.3022719   -.0609278
   sexismale |    -1.5028   1.900481    -0.79   0.431    -5.264685    2.259084
      edpost |   8.187021   2.466085     3.32   0.001     3.305556    13.06849
       _cons |   94.68767   3.418485    27.70   0.000     87.92099    101.4544
------------------------------------------------------------------------------
r; t=0.17 12:31:01

. 
. *average normalized efficiency
. reg average_normalized_efficiency age sexismale edpost 

      Source |       SS       df       MS              Number of obs =     127
-------------+------------------------------           F(  3,   123) =    5.37
       Model |  25794.6921     3  8598.23069           Prob > F      =  0.0016
    Residual |  196856.371   123   1600.4583           R-squared     =  0.1159
-------------+------------------------------           Adj R-squared =  0.0943
       Total |  222651.063   126  1767.07193           Root MSE      =  40.006

------------------------------------------------------------------------------
average_no~y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.6962412    .233727    -2.98   0.003    -1.158889    -.233593
   sexismale |   -5.76163   7.286309    -0.79   0.431    -20.18443    8.661171
      edpost |   31.38846   9.454797     3.32   0.001     12.67327    50.10365
       _cons |   79.63291   13.10623     6.08   0.000     53.68993    105.5759
------------------------------------------------------------------------------
r; t=0.00 12:31:01

. 
. *average optimality frequency
. reg optimal age sexismale edpost 

      Source |       SS       df       MS              Number of obs =     127
-------------+------------------------------           F(  3,   123) =    5.49
       Model |  13137.7827     3  4379.26091           Prob > F      =  0.0014
    Residual |  98171.2724   123  798.140426           R-squared     =  0.1180
-------------+------------------------------           Adj R-squared =  0.0965
       Total |  111309.055   126  883.405199           Root MSE      =  28.251

------------------------------------------------------------------------------
  optimality |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         age |  -.5251631   .1650541    -3.18   0.002    -.8518776   -.1984486
   sexismale |  -4.956678    5.14547    -0.96   0.337    -15.14182    5.228464
      edpost |   21.33482    6.67682     3.20   0.002     8.118464    34.55118
       _cons |   65.62933   9.255402     7.09   0.000     47.30883    83.94983
------------------------------------------------------------------------------
r; t=0.00 12:31:01

. 
. 
. 
. 
. ************************************************
. ************Table 7*****************************
. ****Optimal choice by age and education*********
. ***********Main experiment**********************
. ************************************************
. 
. use choice_experiments, clear
r; t=0.00 12:31:01

. 
. *use only the main experiment data
. keep if experiment==1
(252 observations deleted)
r; t=0.00 12:31:01

. 
. *drop the practice round
. drop if round==1
(127 observations deleted)
r; t=0.00 12:31:01

. 
. preserve
r; t=0.00 12:31:01

. *frequencies across age and education
. bys agegroup education: egen optimal_freq=mean(optimal)
r; t=0.00 12:31:01

. collapse optimal, by(agegroup education)
r; t=0.00 12:31:01

. gen str10 desc="18-40" if agegroup==1
(8 missing values generated)
r; t=0.00 12:31:01

. replace desc="41-60" if agegroup==2
(4 real changes made)
r; t=0.00 12:31:01

. replace desc="Over 60" if agegroup==3
(4 real changes made)
r; t=0.00 12:31:01

. save temp1, replace
file temp1.dta saved
r; t=0.00 12:31:01

. restore
r; t=0.00 12:31:01

. *frequencies across age 
. bys agegroup: egen optimal_freq=mean(optimal)
r; t=0.00 12:31:01

. collapse optimal, by(agegroup)
r; t=0.01 12:31:01

. gen str10 desc="18-40" if agegroup==1
(2 missing values generated)
r; t=0.00 12:31:01

. replace desc="41-60" if agegroup==2
(1 real change made)
r; t=0.00 12:31:01

. replace desc="Over 60" if agegroup==3
(1 real change made)
r; t=0.00 12:31:01

. gen education=99
r; t=0.00 12:31:01

. save temp2, replace
file temp2.dta saved
r; t=0.00 12:31:01

. 
. clear
r; t=0.00 12:31:01

. 
. forval i=1/2 {
  2.         append using temp`i'
  3. }
r; t=0.00 12:31:01

. 
. label define type 1 "High school" 2 "Some college" 3 "College" 4 "Postgraduate" 99 "All" 
r; t=0.00 12:31:01

. label values education type
r; t=0.00 12:31:01

. 
. placevar desc education, first
r; t=0.00 12:31:01

. sort desc education
r; t=0.00 12:31:01

. 
. save table7, replace
(note: file table7.dta not found)
file table7.dta saved
r; t=0.00 12:31:01

. 
. 
. 
. ************************************************
. ************Table 8 ****************************
. ********Demographic characteristics*************
. ******Main and high stakes experiment***********
. ************************************************
. 
. use choice_experiments_wide, clear
r; t=0.00 12:31:01

. 
. drop if agegroup==2
(47 observations deleted)
r; t=0.00 12:31:01

. 
. bys experiment: egen average_age=mean(age)
r; t=0.00 12:31:01

. bys experiment: egen stdev_age=sd(age)
r; t=0.00 12:31:01

. bys experiment: egen percent_male=mean(sexismale)
r; t=0.00 12:31:01

. bys experiment: egen percent_edhigh=mean(edhigh)
r; t=0.00 12:31:01

. bys experiment: egen percent_edsomecol=mean(edsomecol)
r; t=0.00 12:31:01

. bys experiment: egen percent_edcolgrad=mean(edcolgrad)
r; t=0.00 12:31:01

. bys experiment: egen percent_edpost=mean(edpost)
r; t=0.00 12:31:01

. bys experiment: egen nsubjects=count(id)
r; t=0.00 12:31:01

. 
. 
. bys experiment agegroup: egen average_age_ag=mean(age)
r; t=0.00 12:31:01

. bys experiment agegroup: egen stdev_age_ag=sd(age)
r; t=0.00 12:31:01

. bys experiment agegroup: egen percent_male_ag=mean(sexismale)
r; t=0.00 12:31:01

. bys experiment agegroup: egen percent_edhigh_ag=mean(edhigh)
r; t=0.00 12:31:01

. bys experiment agegroup: egen percent_edsomecol_ag=mean(edsomecol)
r; t=0.00 12:31:01

. bys experiment agegroup: egen percent_edcolgrad_ag=mean(edcolgrad)
r; t=0.00 12:31:01

. bys experiment agegroup: egen percent_edpost_ag=mean(edpost)
r; t=0.00 12:31:01

. bys experiment agegroup: egen nsubjects_ag=count(id)
r; t=0.00 12:31:01

. 
. preserve
r; t=0.00 12:31:01

. collapse average_age stdev_age percent_male percent_edhigh percent_edsomecol percent_edcolgrad pe
> rcent_edpost nsubjects, by(experiment)
r; t=0.01 12:31:01

. gen agegroup=0
r; t=0.00 12:31:01

. save temp1, replace
file temp1.dta saved
r; t=0.00 12:31:01

. restore
r; t=0.00 12:31:01

. collapse average_age_ag stdev_age_ag percent_male_ag percent_edhigh_ag percent_edsomecol_ag perce
> nt_edcolgrad_ag percent_edpost_ag nsubjects_ag, by(experiment agegroup)
r; t=0.01 12:31:01

. local var "average_age stdev_age percent_male percent_edhigh percent_edsomecol percent_edcolgrad 
> percent_edpost nsubjects"
r; t=0.00 12:31:01

. foreach i of local var {
  2.         rename `i'_ag `i'
  3. }
r; t=0.00 12:31:01

. save temp2, replace
file temp2.dta saved
r; t=0.00 12:31:01

. 
. use temp1, clear
r; t=0.00 12:31:01

. append using temp2
(label experiment already defined)
r; t=0.00 12:31:01

. 
. sort experiment agegroup
r; t=0.00 12:31:01

. label define ag 0 "All ages" 1 "18 to 40" 2 "41 to 60" 3 "Over 60"
r; t=0.00 12:31:01

. label values agegroup ag
r; t=0.00 12:31:01

. 
. save table8, replace
(note: file table8.dta not found)
file table8.dta saved
r; t=0.00 12:31:01

. 
. 
. 
. 
. ************************************************
. ************Table 9*****************************
. ****(Nearly) Optimal choice and efficiency******
. ************by age and experiment***************
. ************************************************
. 
. use choice_experiments, clear
r; t=0.00 12:31:01

. 
. *use the same rounds used in both the main and high stakes experiments
. keep if round==2 | round==5 | round==7 | round==8
(635 observations deleted)
r; t=0.00 12:31:01

. 
. *use the same agegroups in both experiments
. drop if agegroup==2
(188 observations deleted)
r; t=0.00 12:31:01

. 
. *calculate average efficiency measures
. bys id: egen temp1=total(pay)
r; t=0.00 12:31:01

. bys id: egen temp2=total(best_opt)
r; t=0.00 12:31:01

. bys id: egen temp3=total(average_payoff)
r; t=0.00 12:31:01

. 
. gen average_efficiency=temp1/temp2
r; t=0.00 12:31:01

. gen average_normalized_efficiency=(temp1-temp3)/(temp2-temp3)
r; t=0.00 12:31:01

. drop temp1 temp2 temp3
r; t=0.00 12:31:01

. 
. *frequencies across age and education
. bys agegroup experiment: egen optimal_freq=mean(optimal)
r; t=0.00 12:31:01

. bys agegroup experiment: egen nearly_optimal_freq=mean(optimalten)
r; t=0.00 12:31:01

. bys agegroup experiment: egen subjects=count(id)
r; t=0.00 12:31:01

. replace subjects=subjects/4
(572 real changes made)
r; t=0.00 12:31:01

. collapse (mean) optimal_freq (mean) nearly_optimal_freq (mean) average_efficiency (mean) average_
> normalized_efficiency (mean) subjects, by(agegroup experiment)
r; t=0.01 12:31:01

. gen str10 desc="18-40" if agegroup==1
(2 missing values generated)
r; t=0.00 12:31:01

. replace desc="41-60" if agegroup==2
(0 real changes made)
r; t=0.00 12:31:01

. replace desc="Over 60" if agegroup==3
(2 real changes made)
r; t=0.00 12:31:01

. 
. sort experiment agegroup
r; t=0.00 12:31:01

. placevar optimal_freq nearly_optimal_freq average_efficiency average_normalized_efficiency subjec
> ts, last
r; t=0.00 12:31:01

. 
. save table9, replace
(note: file table9.dta not found)
file table9.dta saved
r; t=0.00 12:31:01

. 
. 
. 
. ************************************************
. ************Table 10****************************
. *********Likelihood of optimal choice***********
. *******Main and high stakes experiments*********
. ************************************************
. 
. use choice_experiments, clear
r; t=0.00 12:31:01

. 
. gen timesq=time*time
r; t=0.00 12:31:01

. gen timesq1000=timesq/1000
r; t=0.00 12:31:01

. gen older=(agegroup==3)
r; t=0.00 12:31:01

. gen older_nopt_dum3=older*nopt_dum3
r; t=0.00 12:31:01

. 
. probit optimal nopt_dum3 natt_dum4 pdf_extreme age sex edpost high_stakes if experiment~=3 & (rou
> nd==2 | round==5 | round==7 | round==8) & agegroup~=2, robust cluster(id)

Iteration 0:   log pseudolikelihood = -387.33696  
Iteration 1:   log pseudolikelihood = -345.37372  
Iteration 2:   log pseudolikelihood =  -345.2759  
Iteration 3:   log pseudolikelihood =  -345.2759  

Probit regression                                 Number of obs   =        572
                                                  Wald chi2(7)    =      63.87
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood =  -345.2759                 Pseudo R2       =     0.1086

                                   (Std. Err. adjusted for 143 clusters in id)
------------------------------------------------------------------------------
             |               Robust
     optimal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   nopt_dum3 |  -.2885326   .1045554    -2.76   0.006    -.4934575   -.0836078
   natt_dum4 |  -.1498645   .0938179    -1.60   0.110    -.3337442    .0340153
 pdf_extreme |   .3963374   .0952326     4.16   0.000      .209685    .5829899
         age |  -.0232394   .0039181    -5.93   0.000    -.0309188     -.01556
   sexismale |  -.2261531   .1447792    -1.56   0.118    -.5099151     .057609
      edpost |   .5288353   .1744723     3.03   0.002     .1868758    .8707948
 high_stakes |  -.1156324   .1492306    -0.77   0.438     -.408119    .1768542
       _cons |   .9776944   .2592422     3.77   0.000     .4695891      1.4858
------------------------------------------------------------------------------
r; t=0.03 12:31:01

. 
. probit optimal nopt_dum3 natt_dum4 pdf_extreme age sex edpost older_nopt_dum3 high_stakes if expe
> riment~=3 & (round==2 | round==5 | round==7 | round==8) & agegroup~=2, robust cluster(id)

Iteration 0:   log pseudolikelihood = -387.33696  
Iteration 1:   log pseudolikelihood = -343.31914  
Iteration 2:   log pseudolikelihood = -343.13301  
Iteration 3:   log pseudolikelihood = -343.13299  

Probit regression                                 Number of obs   =        572
                                                  Wald chi2(8)    =      69.16
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -343.13299                 Pseudo R2       =     0.1141

                                   (Std. Err. adjusted for 143 clusters in id)
------------------------------------------------------------------------------
             |               Robust
     optimal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   nopt_dum3 |  -.0693426   .1402778    -0.49   0.621     -.344282    .2055968
   natt_dum4 |  -.1644359   .0965388    -1.70   0.089    -.3536485    .0247767
 pdf_extreme |   .4064971   .0952646     4.27   0.000      .219782    .5932123
         age |   -.017962   .0047315    -3.80   0.000    -.0272356   -.0086884
   sexismale |  -.2313006   .1451464    -1.59   0.111    -.5157824    .0531812
      edpost |   .5400146   .1743284     3.10   0.002     .1983373    .8816919
older_nopt~3 |  -.4489942   .2156792    -2.08   0.037    -.8717176   -.0262708
 high_stakes |  -.1121415   .1495977    -0.75   0.453    -.4053477    .1810646
       _cons |   .7197875   .2805921     2.57   0.010     .1698372    1.269738
------------------------------------------------------------------------------
r; t=0.03 12:31:01

. 
. probit optimal nopt_dum3 natt_dum4 pdf_extreme age sex edpost older_nopt_dum3 high_stakes time ti
> mesq1000 if experiment~=3 & (round==2 | round==5 | round==7 | round==8) & agegroup~=2, robust clu
> ster(id)

Iteration 0:   log pseudolikelihood = -387.33696  
Iteration 1:   log pseudolikelihood =  -335.4071  
Iteration 2:   log pseudolikelihood = -335.10831  
Iteration 3:   log pseudolikelihood = -335.10809  
Iteration 4:   log pseudolikelihood = -335.10809  

Probit regression                                 Number of obs   =        572
                                                  Wald chi2(10)   =      81.35
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -335.10809                 Pseudo R2       =     0.1348

                                   (Std. Err. adjusted for 143 clusters in id)
------------------------------------------------------------------------------
             |               Robust
     optimal |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   nopt_dum3 |  -.1690183   .1457306    -1.16   0.246    -.4546451    .1166085
   natt_dum4 |  -.2630576   .1073473    -2.45   0.014    -.4734544   -.0526608
 pdf_extreme |    .440237   .1001155     4.40   0.000     .2440142    .6364597
         age |  -.0183019   .0045887    -3.99   0.000    -.0272957   -.0093081
   sexismale |  -.2019538   .1396952    -1.45   0.148    -.4757513    .0718438
      edpost |   .5225023   .1710428     3.05   0.002     .1872645      .85774
older_nopt~3 |   -.458464   .2234904    -2.05   0.040    -.8964972   -.0204308
 high_stakes |  -.1702158   .1425148    -1.19   0.232    -.4495398    .1091081
        time |    .004773   .0012899     3.70   0.000     .0022448    .0073013
  timesq1000 |  -.0027653   .0009747    -2.84   0.005    -.0046756    -.000855
       _cons |   .6037256    .275104     2.19   0.028     .0645316     1.14292
------------------------------------------------------------------------------
r; t=0.04 12:31:01

. 
. 
. 
. 
. 
. ************************************************
. ************Table 11****************************
. ***********Heuristics***************************
. ************************************************
. 
. clear
r; t=0.00 12:31:01

. 
. insheet using heuristics_data.csv
(9 vars, 8636 obs)
r; t=0.13 12:31:01

. 
. gen csevar=subj*10+round
r; t=0.00 12:31:01

. 
. gen agegroup=2
r; t=0.00 12:31:01

. replace agegroup=1 if age<41
(2380 real changes made)
r; t=0.00 12:31:01

. replace agegroup=3 if age>60
(3060 real changes made)
r; t=0.00 12:31:01

. 
. *all decisions
. clogit chosen pay tal lex undom, group(csevar)

Iteration 0:   log likelihood = -1766.7983  
Iteration 1:   log likelihood = -1730.3463  
Iteration 2:   log likelihood = -1729.4923  
Iteration 3:   log likelihood =   -1729.49  
Iteration 4:   log likelihood =   -1729.49  

Conditional (fixed-effects) logistic regression   Number of obs   =       8636
                                                  LR chi2(4)      =     555.48
                                                  Prob > chi2     =     0.0000
Log likelihood =   -1729.49                       Pseudo R2       =     0.1384

------------------------------------------------------------------------------
      chosen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         pay |   3.468815   .3226901    10.75   0.000     2.836354    4.101276
         tal |   4.842606   .5761995     8.40   0.000     3.713276    5.971937
         lex |   1.868963   .2729172     6.85   0.000     1.334055    2.403871
       undom |   .2774368   .1823368     1.52   0.128    -.0799367    .6348102
------------------------------------------------------------------------------
r; t=0.36 12:31:01

. 
. *for each age group
. clogit chosen pay tal lex undom if agegroup==1, group(csevar)

Iteration 0:   log likelihood = -439.33182  
Iteration 1:   log likelihood =  -429.0744  
Iteration 2:   log likelihood = -428.74569  
Iteration 3:   log likelihood = -428.74492  
Iteration 4:   log likelihood = -428.74492  

Conditional (fixed-effects) logistic regression   Number of obs   =       2380
                                                  LR chi2(4)      =     248.86
                                                  Prob > chi2     =     0.0000
Log likelihood = -428.74492                       Pseudo R2       =     0.2249

------------------------------------------------------------------------------
      chosen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         pay |   4.144484   .6849245     6.05   0.000     2.802057    5.486912
         tal |   3.325374   1.123411     2.96   0.003     1.123529     5.52722
         lex |   2.660513   .5536118     4.81   0.000     1.575453    3.745572
       undom |   .8876484   .4243616     2.09   0.036     .0559149    1.719382
------------------------------------------------------------------------------
r; t=0.16 12:31:02

. 
. clogit chosen pay tal lex undom if agegroup==1, group(csevar)

Iteration 0:   log likelihood = -439.33182  
Iteration 1:   log likelihood =  -429.0744  
Iteration 2:   log likelihood = -428.74569  
Iteration 3:   log likelihood = -428.74492  
Iteration 4:   log likelihood = -428.74492  

Conditional (fixed-effects) logistic regression   Number of obs   =       2380
                                                  LR chi2(4)      =     248.86
                                                  Prob > chi2     =     0.0000
Log likelihood = -428.74492                       Pseudo R2       =     0.2249

------------------------------------------------------------------------------
      chosen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         pay |   4.144484   .6849245     6.05   0.000     2.802057    5.486912
         tal |   3.325374   1.123411     2.96   0.003     1.123529     5.52722
         lex |   2.660513   .5536118     4.81   0.000     1.575453    3.745572
       undom |   .8876484   .4243616     2.09   0.036     .0559149    1.719382
------------------------------------------------------------------------------
r; t=0.11 12:31:02

. 
. clogit chosen pay tal lex undom if agegroup==1, group(csevar)

Iteration 0:   log likelihood = -439.33182  
Iteration 1:   log likelihood =  -429.0744  
Iteration 2:   log likelihood = -428.74569  
Iteration 3:   log likelihood = -428.74492  
Iteration 4:   log likelihood = -428.74492  

Conditional (fixed-effects) logistic regression   Number of obs   =       2380
                                                  LR chi2(4)      =     248.86
                                                  Prob > chi2     =     0.0000
Log likelihood = -428.74492                       Pseudo R2       =     0.2249

------------------------------------------------------------------------------
      chosen |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
         pay |   4.144484   .6849245     6.05   0.000     2.802057    5.486912
         tal |   3.325374   1.123411     2.96   0.003     1.123529     5.52722
         lex |   2.660513   .5536118     4.81   0.000     1.575453    3.745572
       undom |   .8876484   .4243616     2.09   0.036     .0559149    1.719382
------------------------------------------------------------------------------
r; t=0.11 12:31:02

. 
. 
. 
. 
. ************************************************
. ************Table 12****************************
. *******Selection frequency for each option******
. *********by age groups**************************
. ***********Validation***************************
. ************************************************
. 
. clear
r; t=0.00 12:31:02

. 
. insheet using validation_experiment_data.csv
(11 vars, 66 obs)
r; t=0.01 12:31:02

. 
. reshape long opt, i(id) j(round)
(note: j = 1 2 3 4 5 6 7 8 9)

Data                               wide   ->   long
-----------------------------------------------------------------------------
Number of obs.                       66   ->     594
Number of variables                  11   ->       4
j variable (9 values)                     ->   round
xij variables:
                     opt1 opt2 ... opt9   ->   opt
-----------------------------------------------------------------------------
r; t=0.06 12:31:02

. 
. *drop the comprehension round
. drop if round==1
(66 observations deleted)
r; t=0.00 12:31:02

. 
. gen task=1
r; t=0.00 12:31:02

. replace task=4 if round==3 | round==7
(132 real changes made)
r; t=0.00 12:31:02

. replace task=3 if round==4 | round==8
(132 real changes made)
r; t=0.00 12:31:02

. replace task=2 if round==5 | round==9
(132 real changes made)
r; t=0.00 12:31:02

. 
. gen agegroup=3
r; t=0.00 12:31:02

. replace agegroup=1 if age<41
(272 real changes made)
r; t=0.00 12:31:02

. 
. label define agegroup 1 "Younger" 3 "Older"
r; t=0.00 12:31:02

. label values agegroup agegroup
r; t=0.00 12:31:02

. 
. forval i=1/6 {
  2.         gen temp=(opt==`i')
  3.         bys task agegroup: egen option`i'_freq=mean(temp)
  4.         drop temp
  5. }
r; t=0.01 12:31:02

. 
. collapse (mean) option1_freq (mean) option2_freq (mean) option3_freq (mean) option4_freq (mean) o
> ption5_freq (mean) option6_freq, by(task agegroup)
r; t=0.01 12:31:02

. 
. save table12, replace
(note: file table12.dta not found)
file table12.dta saved
r; t=0.00 12:31:02

. 
. 
end of do-file
      name:  <unnamed>
       log:  H:\Dropbox\office\choice\stata\for restat\2_tables.log
  log type:  text
 closed on:  14 May 2012, 12:31:02
---------------------------------------------------------------------------------------------------
